#include <reg52.h>
typedef unsigned int u16;
typedef unsigned char u8;
sbit LED = P1 ^ 0;

void delay(u16 num);
u8 cnt,sec = 0;
unsigned char code LedChar[] = {
0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,
0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E
};
void main()
{
  P0 = 0X00;
    P0 = 0X00;
   TMOD = 0X01;
   TH0 = 0XB1;
   TL0 = 0XE0;
   TR0 = 1;

   TR2 = 1;

    while (1)
    {
        if(TF0 == 1)
        {
            TF0 = 0;
            TH0 = 0XB1;
            TL0 = 0XE0;
            cnt++;
            if(cnt == 50)
            {
                cnt = 0;
                P0 = ~LedChar[sec++];
                if(sec == 16)
                {
                    sec = 0;
                }
            }

        }


    }
}
void delay(u16 num)
{
    while(num--);
}